* This do file will replicate the analysis presented in Jonathan M. DiCicco and Benjamin O. Fordham, 
* "The Things They Carried: Generational Effects of the Vietnam War on Elite Opinion." The paper employs
* data collected by Ole Holsti and James Rosenau as part of their Foreign Policy Leadership Project.
* The original data and documentation are housed at the Inter-University Consortium for Political and
* Social Research (ICPSR), as ICPSR 2614. Although this replication data file contains the ICPSR data, 
* we encourage researchers to consult the original ICPSR data for more information.

* Before running this file, place the six datasets into your preferred directory, then replace 
* "[preferred directory]" in the command below with the path name of this directory.
 
cd "[preferred directory]" 

***************
* 1976 survey *
***************
infix 4 lines 1:vietpos1 13 vietpos2 14 2:angola 22 3:sex 53 yrborn 54-55 occupation 58-59 milserve 74 milbegyr 77-78 milendyr 79-80 4:ideology 17 party 25 using fplp1976.txt, clear

label var vietpos1 "Position on Vietnam War in its early years"
label var vietpos2 "Position on Vietnam War in its later years"
label var angola "Avoid involvement in Angolan civil war (Q222)"

* Recoding occupational categories for fixed effects
* Combinations of occupations, entertainers, and others will be coded
* together as "Other." 
gen occcat=occupation
la val occcat occupation
replace occcat=20 if occcat>=20
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Educator" 14 "Clergy" 15 "Military Officer" 16 "Public Official" 17 "Communications" 18 "Lawyer" 19 "Physician" 20 "Other", replace

* Table 1, 1976 statistics
tab occcat

* Opinion trajectories on Vietnam
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen viethawk=vietpos2
recode viethawk (1=3) (2=1) (3=2) (4=2) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if critic==.&begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
replace convsupp=0 if convsupp==. & endhawk~=.
gen convcrit=1 if enddove==1 & begdove~=1
replace convcrit=0 if convcrit==. & enddove~=.
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1976 statistics
tab vnpos

* Recoding and labeling birth year data
gen cohort=yrborn
recode cohort 0=1
la de cohort 1 "Before 1924" 2 "1924-33" 3 "1933-40" 4 "After 1940", replace
la val cohort cohort
la var cohort "Birth cohort"

* Table 3, 1976 statistics
tab cohort

* Vietnam generation variable from birth year
gen vietgen=yrborn
recode vietgen (0=.) (1=1) (2=0) (3=0) (4=0)

* Coding service in Vietnam
recode milbegyr (0=.) (88=.) (99=.)
recode milendyr (0=.) (88=.) (99=.)
gen vnserve=1 if milbegyr<=73 & milendyr>=65
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1976 data (Appendix)
tab occcat vnserve, row 

* Recoding gender
gen male=sex
recode male (1=1) (2=0) (8=.) (9=.)

* Table A-2, 1976 analysis (Appendix)
mlogit vnpos i.male i.vnserve i.vietgen, baseoutcome(3)
est store full

* Marginal effects reported in Figure 1
* Effect of military service on person from Vietnam generation
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(1))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(2))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(3))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(4))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(5))

* Effect of being in Vietnam generation, versus earlier generation, without military service
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(1))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(2))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(3))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(4))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(5))

* Model comparison statistics reported in Table A-2
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=., baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables indicating party identification
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable indicating ideology
* The analysis uses a five category ideology variable recoded from the seven-category variable in the original
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variable: strong support for intervention in Angola
gen angola01=angola
recode angola01 (0=1) (1=0) (2=0) (3=0) (4=0)

* Table A-3 (Appendix)
logit angola01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat
est store full
quietly logit angola01 republican democrat i.ideology5 i.occcat if critic~=.
est store pionly
est stats full pionly
lrtest full pionly

* Marginal effects reported in Figure 3
est res full
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==20)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==20)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==20)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==20)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==20)

***************
* 1980 survey *
***************
infix 4 lines 1: vietpos1 14 vietpos2 15 iran 17 afgimp 25 2:salt 62 3:sex 34 birthyr 35-36 occupation 39-40 milserve 50 vncheck1 51 vncheck2 52 ideology 65 party 66 using fplp1980.txt, clear

label var vietpos1 "Position in Vietnam War when it forst became an issue (Q514)"
label var vietpos2 "Position in Vietnam War late in the war (Q515)"
label var iran "Position on use of force in Iran when embassy taken over (Q517)"
label var afgimp "Soviet invastion of Afghanistan not important? (Q525)"
label var salt "Position on the SALT process (Q662)"

* Occupational category variable
gen occcat=occupation
replace occcat=21 if occcat>21
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Educator" 14 "Clergy" 15 "Military Officer" 16 "Foreign Service" 17 "Public Official" 18 "Communications" 19 "Lawyer" 20 "Health Care" 21 "Other", replace
la val occcat occcat

* Table 1, 1980 statistics
tab occcat

* Opinion trajectories on the Vietnam War
gen viethawk=vietpos2
recode viethawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen vietdove=vietpos2
recode vietdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen newdove=1 if vietpos1~=2 & vietpos2==2
gen newhawk=1 if vietpos1~=1 & vietpos2==1
recode newhawk newdove (.=0) if vietpos1~=8 & vietpos2~=8
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
gen convcrit=1 if enddove==1 & begdove~=1
recode convsupp convcrit (.=0)
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1980 statistics
tab vnpos

* Age distribution variable
gen cohort=birthyr
recode cohort 89=.
la de cohort 0 "1900-09" 1 "1910-19" 2 "1920-29" 3 "1930-39" 4 "1940-49" 5 "1950-59" 6 "1960-69", replace
la val cohort cohort
la var cohort "Decade of Birth"

* Table 3, 1980 statistics
tab cohort 

* Vietnam generation variable
gen vietgen=birthyr
recode vietgen (0=0) (1=0) (2=0) (3=0) (4=1) (5=1) (6=0) (89=.)

* Military service during Vietnam War
gen vnserve=1 if milserve==6
replace vnserve=1 if milserve==3 & vncheck1>=1 & vncheck1<=7
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1980 data (Appendix)
tab occcat vnserve, row 

* Recoding gender variable
gen male=sex
recode male (1=1) (2=0) (8=.) (9=.)
 
* Table A-2, 1980 (Appendix)
* Effect of generation, military service on Vietnam outlook
mlogit vnpos i.male i.vnserve i.vietgen if birthyr~=6, baseoutcome(3)
est store full
* Model fit statistics reported for 1980 in Table A-2
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=. & birthyr~=6, baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables for party
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable indicating ideology
* The analysis uses a five-category ideology variable
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variables
* Strongly agree that Soviet action in Afghanistan affect U.S. interests
gen afgimp01=afgimp
recode afgimp01 (1=0) (2=0) (3=0) (4=1) (5=0) (8=.) (9=.)

* Favored an immediate use of force in Iran when hostages taken
gen iran01=iran
recode iran01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)

* Strongly agree that the SALT process would jeopardize American security
gen saltbad=salt
recode saltbad (1=0) (2=0) (3=0) (4=1) (5=0) (8=.) (9=.)

* Table A-4 (Appendix)
* Strongly agree that Soviet action in Afghanistan affect U.S. interests
logit afgimp01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store afull
quietly logit afgimp01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats afull pionly
lrtest afull pionly

* Favored an immediate use of force in Iran when hostages taken
logit iran01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store ifull
quietly logit iran01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats ifull pionly
lrtest ifull pionly

* SALT process would jeopardize U.S. security
logit saltbad critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store sfull
quietly logit saltbad republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats sfull pionly
lrtest sfull pionly

* The following sets of marginal effects were used to produce Figure 4
* Marginal effects on Afghanistan question reported in Figure 4
est res afull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Marginal effects on Iran question reported in Figure 4
est res ifull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Marginal effects on SALT question reported in Figure 4
est res sfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)
 
***************
* 1984 survey *
***************
infix 4 lines 1: vietpos1 16 vietpos2 17 lebinv2 19 afgrebel 22 2:missiles 73 salvador 74 nicaragua 75 3:sex 50 birthyr 51-52 occupation 55-56 milserve 64 milbeg 65-66 milend 67-68 ideology 69 party 70 using fplp1984.txt, clear

label var vietpos1 "Position in Vietnam War when it first became an issue (Q116)"
label var vietpos2 "Position in Vietnam War late in the war (Q117)"
label var lebinv2 "Position on intervention in Lebanon after Marine barracks bombing (Q119)"
label var afgrebel "US should support Afghan rebels (Q122)"
label var missiles "Position on deploying new missiles in Europe (Q273)"
label var salvador "Position on sending advisers to El Salvador (Q274)"
label var nicaragua "Position on aid to rebels in Nicaragua (Q275)"

* Occupational category variable
gen occcat=occupation
replace occcat=21 if occcat>21
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Educator" 14 "Clergy" 15 "Military Officer" 16 "Communications" 17 "Lawyer" 18 "Health Care" 19 "State Department official" 20 "Public official" 21 "Other", replace
la val occcat occcat

* Table 1, 1984 statistics
tab occcat

* Positions on the Vietnam War
gen viethawk=vietpos2
recode viethawk (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
gen vietdove=vietpos2
recode vietdove (1=0) (2=1) (3=0) (4=0) (8=.) (9=.)
gen newdove=1 if vietpos1~=2 & vietpos2==2
gen newhawk=1 if vietpos1~=1 & vietpos2==1
recode newhawk newdove (.=0) if vietpos1~=8 & vietpos2~=8
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
gen convcrit=1 if enddove==1 & begdove~=1
recode convsupp convcrit (.=0)
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1984 statistics
tab vnpos

* Age distribution variable
gen cohort=birthyr
recode cohort 99=.
la de cohort 0 "1900-09" 1 "1910-19" 2 "1920-29" 3 "1930-39" 4 "1940-49" 5 "1950-59" 6 "1960-69", replace
la val cohort cohort
la var cohort "Decade of Birth"

* Table 3, 1984 statistics
tab cohort 

* Vietnam generation variable
gen vietgen=birthyr
recode vietgen (0=0) (1=0) (2=0) (3=0) (4=1) (5=1) (6=0) (99=.)

* Variable indicating military service during Vietnam War
gen vnserve=1 if milserve==1 & milbeg<=72 & milend>=65
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1984 data (Appendix)
tab occcat vnserve, row 

* Recoding gender variable
gen male=sex
recode male (1=1) (2=0) (8=.) (9=.)


* Table A-2, 1984 (Appendix)
mlogit vnpos i.male i.vnserve i.vietgen if birthyr~=6, baseoutcome(3)
est store full
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=. & birthyr~=6, baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables for party
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable indicating ideology
* The analysis uses a five-category ideology variable
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variables
* Strongly support new missile deployment in Europe
gen missiles01=missiles
recode missiles01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly agree U.S. should support Afghan rebels
gen afgrebel01=afgrebel
recode afgrebel01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly support sending military advisers to El Salvador
gen salvador01=salvador
recode salvador01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly support aid for rebels in Nicaragua
gen nicaragua01=nicaragua
recode nicaragua01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Favored maintaining forces in Lebanon after Marine barracks bombing
gen lebinv201=lebinv2
recode lebinv201 (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)


* Table A-5 (Appendix)
* Strongly support new missile deployment in Europe
logit missiles01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store mfull
test critic convcrit supporter convsupp
quietly logit missiles01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats mfull pionly
lrtest mfull pionly

* Strongly agree U.S. should support Afghan rebels
logit afgrebel01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store afull
quietly logit afgrebel01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats afull pionly
lrtest afull pionly

* Strongly support sending military advisers to El Salvador
logit salvador01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store sfull
quietly logit salvador01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats sfull pionly
lrtest sfull pionly

* Strongly support aid for rebels in Nicaragua
logit nicaragua01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store nfull
quietly logit nicaragua01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats nfull pionly
lrtest nfull pionly

* Favored maintaining forces in Lebanon after Marine barracks bombing
logit lebinv201 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store lfull
quietly logit lebinv201 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats lfull pionly
lrtest lfull pionly


* Marginal effects used to produce Figure 5
* Strongly support new missile deployment in Europe
est res mfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly agree U.S. should support Afghan rebels
est res afull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly support sending military advisers to El Salvador
est res sfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly support aid for rebels in Nicaragua
est res nfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Favored maintaining forces in Lebanon after Marine barracks bombing
est res lfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)
 
***************
* 1988 survey *
***************
infix 3 lines 1: vietpos1 17 vietpos2 18 inf 21 2:salvador 65 nicaragua 66 pergulf 75 libya 79 3:sex 56 birthyr 57-58 education 59 occupation 61-62 milserve 72 milbranch 73 ideology 74 party 75 using fplp1988.txt, clear

label var vietpos1 "Position in Vietnam War when it forst became an issue (Q117)"
label var vietpos2 "Position in Vietnam War late in the war (Q118)"
label var inf "Soviets are likely to violate the INF treaty (Q121)"
label var salvador "Position on sending advisers to El Salvador (Q266)"
label var nicaragua "Position on aid to rebels in Nicaragua (Q267)"
label var pergulf "Position on deploying naval forces to Persian Gulf (Q275)"
label var libya "Position on bombing Libya in 1986 (Q279)"

* Occupational category variable
gen occcat=occupation
replace occcat=21 if occcat>21
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Health Care" 14 "Clergy" 15 "Military Officer" 16 "Communications" 17 "Lawyer" 18 "Educator" 19 "State Department official" 20 "Public official" 21 "Other", replace
la val occcat occcat

* Table 1, 1988 statistics
tab occcat

* Positions on the Vietnam War
gen viethawk=vietpos2
recode viethawk (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
gen vietdove=vietpos2
recode vietdove (1=0) (2=1) (3=0) (4=0) (8=.) (9=.)
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
gen convcrit=1 if enddove==1 & begdove~=1
recode convsupp convcrit (.=0)
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1988 statistics
tab vnpos

* Age distribution variable
gen cohort=birthyr
recode cohort 99=.
la de cohort 0 "1900-09" 1 "1910-19" 2 "1920-29" 3 "1930-39" 4 "1940-49" 5 "1950-59" 6 "1960-69", replace
la val cohort cohort
la var cohort "Decade of Birth"

* Table 3, 1988 statistics
tab cohort 

* Vietnam generation variable
gen vietgen=birthyr
recode vietgen (0=0) (1=0) (2=0) (3=0) (4=1) (5=1) (6=0) (99=.)

* Variable indicating military service during Vietnam War
gen vnserve=1 if milserve==1 & vietgen==1
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1988 data (Appendix)
tab occcat vnserve, row 

* Recoding gender variable
gen male=sex
recode male (1=1) (2=0) (8=.) (9=.)

* Table A-2 (Appendix)
mlogit vnpos i.male i.vnserve i.vietgen if birthyr~=6, baseoutcome(3)
est store full
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=. & birthyr~=6, baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables for party
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable for ideology
* The analysis uses a five-category ideology variable
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variables:
* Strongly agree Soviets will violate INF treaty obligations
gen inf01=inf
recode inf01 (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
* Strongly support sending military advisers to El Salvador
gen salvador01=salvador
recode salvador01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly support aid for rebels in Nicaragua
gen nicaragua01=nicaragua
recode nicaragua01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly support not invoking the War Powers Act after naval deployment in Persian Gulf
gen pergulf01=pergulf
recode pergulf01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly supported 1986 bombing of Libya
gen libya01=libya
recode libya01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)

* Table A-6 (Appendix)
* Strongly agree Soviets will violate INF treaty obligations
logit inf01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store ifull
quietly logit inf01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats ifull pionly
lrtest ifull pionly

* Strongly support sending military advisers to El Salvador
logit salvador01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store sfull
quietly logit salvador01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats sfull pionly
lrtest sfull pionly

* Strongly support aid for rebels in Nicaragua
logit nicaragua01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store nfull
quietly logit nicaragua01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats nfull pionly
lrtest nfull pionly

* Strongly support not invoking the War Powers Act after naval deployment in Persian Gulf
logit pergulf01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store pfull
quietly logit pergulf01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats pfull pionly
lrtest pfull pionly

* Strongly supported 1986 bombing of Libya
logit libya01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store lfull
quietly logit libya01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats lfull pionly
lrtest lfull pionly

* Marginal effects used to produce Figure 6
* Strongly agree Soviets will violate INF treaty obligations
est res ifull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly support sending military advisers to El Salvador
est res sfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly support aid for rebels in Nicaragua
est res nfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly support not invoking the War Powers Act after naval deployment in Persian Gulf
est res pfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly supported 1986 bombing of Libya
est res lfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

***************
* 1992 survey *
***************
infix 4 lines 1: gulfwar 12 panama 25 endpgwar 34 2:vietpos1 34 vietpos2 35 4: sex 7 birthyr 8-9 education 10 occupation 12-13 milserve 21 milbranch 22 ideology 25 party 26 using fplp1992.txt, clear

label var gulfwar "Position on use of force before war began in 1991 Gulf War (Q112)"
label var panama "Approval of invasion of Panama (Q125)"
label var endpgwar "Ending Persian Gulf War while Saddam Hussein still in power (Q134)"
label var vietpos1 "Position in Vietnam War when it forst became an issue (Q234)"
label var vietpos2 "Position in Vietnam War late in the war (Q235)"

* Occupational category variable
gen occcat=occupation
replace occcat=21 if occcat>21
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Health Care" 14 "Clergy" 15 "Military Officer" 16 "Communications" 17 "Lawyer" 18 "Educator" 19 "State Department official" 20 "Public official" 21 "Other", replace
la val occcat occcat

* Table 1, 1992 statistics
tab occcat

* Attitude trajectories on the Vietnam War
gen viethawk=vietpos2
recode viethawk (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
gen vietdove=vietpos2
recode vietdove (1=0) (2=1) (3=0) (4=0) (8=.) (9=.)
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
gen convcrit=1 if enddove==1 & begdove~=1
recode convsupp convcrit (.=0)
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1992 statistics
tab vnpos

* Age distribution variable
gen cohort=birthyr
recode cohort 99=.
la de cohort 0 "1900-09" 1 "1910-19" 2 "1920-29" 3 "1930-39" 4 "1940-49" 5 "1950-59" 6 "1960-69", replace
la val cohort cohort
la var cohort "Decade of Birth"

* Table 3, 1992 statistics
tab cohort 

* Vietnam generation variable
gen vietgen=birthyr
recode vietgen (0=0) (1=0) (2=0) (3=0) (4=1) (5=1) (6=0) (99=.)

* Variable indicating military service during Vietnam War
gen vnserve=1 if milserve==1 & vietgen==1
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1992 data (Appendix)
tab occcat vnserve, row 

* Recoding gender variable
gen male=sex
recode male (1=1) (2=0) (9=.)

* Table A-2, 1992 (Appendix)
mlogit vnpos i.male i.vnserve i.vietgen if birthyr~=6, baseoutcome(3)
est store full
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=. & birthyr~=6, baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables indicating party identification
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable indicating ideology
* The analysis uses a five-cateogry ideology variable
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variables
* Strongly supported 1989 invasion of Panama
gen panama01 =panama
recode panama01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Favored use of force right away after Iraqi invasion of Kuwait
gen gulfwar01=gulfwar
recode gulfwar01 (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
* Strongly opposed ending the Persian Gulf War with Saddam Hussein still in power
gen endpgwar01=endpgwar
recode endpgwar01 (1=0) (2=0) (3=0) (4=1) (5=0) (8=.) (9=.)

* Table A-7 (Appendix)
* Strongly supported 1989 invasion of Panama
logit panama01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store pfull
quietly logit panama01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats pfull pionly
lrtest pfull pionly

* Favored use of force right away after Iraqi invasion of Kuwait
logit gulfwar01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store gfull
quietly logit gulfwar01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats gfull pionly
lrtest gfull pionly

* Strongly opposed ending the Persian Gulf War with Saddam Hussein still in power
logit endpgwar01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store efull
quietly logit endpgwar01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats efull pionly
lrtest efull pionly
log off

* Marginal effects reported in Figure 7
* Strongly supported 1989 invasion of Panama
est res pfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Favored use of force right away after Iraqi invasion of Kuwait
est res gfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly opposed ending the Persian Gulf War with Saddam Hussein still in power
est res efull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

***************
* 1996 survey *
***************
infix 4 lines 1: bosnia 12 iraq 15 cuba 16 somalia 76 2:nato 9 3:vietpos1 22 vietpos2 23 4:sex 10 birthyr 11-12 education 13 occupation 15-16 milserve 25 ideology 27 party 28 using fplp1996.txt, clear

label var bosnia "Position on sending troops to Bosnia when decision announced (Q112)"
label var iraq "Support use of troops if Iraq invaded Saudi Arabia (Q115)"
label var cuba "Support use of troops if Cuban people attempt to overthrow Castro (Q116)"
label var somalia "US should use troops to end civil war in Somalia (Q176)"
label var nato "NATO should expand to include Poland, Hungary, Slovakia, Czech Rep. (Q209)"

* Occupational category variable
gen occcat=occupation
replace occcat=21 if occcat>21
la de occcat 11 "Business Executive" 12 "Labor official" 13 "Health Care" 14 "Educator" 15 "Military Officer" 16 "Communications" 17 "Lawyer" 18 "Clergy" 19 "State Department official" 20 "Public official" 21 "Other", replace
la val occcat occcat

* Table 1, 1996 statistics
tab occcat

* Attitude trajectories on the Vietnam War
gen viethawk=vietpos2
recode viethawk (1=1) (2=0) (3=0) (4=0) (8=.) (9=.)
gen vietdove=vietpos2
recode vietdove (1=0) (2=1) (3=0) (4=0) (8=.) (9=.)
gen beghawk=vietpos1
recode beghawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen begdove=vietpos1
recode begdove (1=0) (2=1) (3=0) (4=0) (8=.)
gen endhawk=vietpos2
recode endhawk (1=1) (2=0) (3=0) (4=0) (8=.)
gen enddove=vietpos2
recode enddove (1=0) (2=1) (3=0) (4=0) (8=.)
gen supporter=1 if beghawk==1&endhawk==1
replace supporter=0 if supporter==.&beghawk~=.&endhawk~=.
gen critic=1 if begdove==1 & enddove==1
recode critic (.=0) if begdove~=.&enddove~=.
gen convsupp=1 if endhawk==1 & beghawk~=1
gen convcrit=1 if enddove==1 & begdove~=1
recode convsupp convcrit (.=0)
gen ambivalent=1 if endhawk~=1 & enddove~=1
recode ambivalent (.=0) if endhawk~=. & enddove~=.
gen vnpos=1 if supporter==1
replace vnpos=2 if convsupp==1
replace vnpos=3 if ambivalent==1
replace vnpos=4 if convcrit==1
replace vnpos=5 if critic==1
la de vnpos 1 "Consistent supporter" 2 "Converted supporter" 3 Ambivalent 4 "Converted critic" 5 "Consistent critic", replace
la val vnpos vnpos

* Table 2, 1996 statistics
tab vnpos

* Age distribution variable
gen cohort=birthyr
recode cohort 99=.
la de cohort 0 "1900-09" 1 "1910-19" 2 "1920-29" 3 "1930-39" 4 "1940-49" 5 "1950-59" 6 "1960-69", replace
la val cohort cohort
la var cohort "Decade of Birth"

* Table 3, 1996 statistics
tab cohort 

* Vietnam generation variable
gen vietgen=birthyr
recode vietgen (0=0) (1=0) (2=0) (3=0) (4=1) (5=1) (6=0) (99=.)

* Variable indicating military service during Vietnam War
gen vnserve=1 if milserve==1 & vietgen==1
recode vnserve .=0
la var vnserve "Military service during the Vietnam War?"
la de vnserve 0 No 1 Yes, replace
la val vnserve vnserve

* Table A-1, 1996 data (Appendix)
tab occcat vnserve, row 

* Recoding gender variable
gen male=sex
recode male (1=1) (2=0) (9=.)

* Table A-2, 1996 (Appendix)
* Effect of generation, military service on Vietnam outlook
mlogit vnpos i.male i.vnserve i.vietgen if birthyr~=6, baseoutcome(3)
est store full
quietly mlogit vnpos i.male if vietgen~=. & vnserve~=. & birthyr~=6, baseoutcome(3)
est store monly
est stats full monly
lrtest full monly

* Marginal effects used to produce Figure 2
est res full
* Effect of military service on person from Vietnam generation
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(1))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(2))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(3))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(4))
margins i.vnserve, at(vietgen=1 male=1) predict(outcome(5))
* Effect of being in Vietnam generation (or earlier generation) without military service
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(1))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(2))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(3))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(4))
margins i.vietgen, at(vnserve=0 male=1) predict(outcome(5))

* Analysis of post-Vietnam policy views; marginal effects reported in the paper, full model results
* provided in the Appendix.
* Control variables indicating party identification
gen republican=1 if party==1
gen democrat=1 if party==2
recode democrat republican (.=0)
replace democrat=. if party>=8 & party<=9
replace republican=. if party>=8 & party<=9

* Control variable indicating ideology
* Analysis uses five-category ideology variable
recode ideology (0=.) (8=.) (9=.)
label var ideology "Liberal-conservative ideology"
la de ideology 1 "Far left" 2 "Very liberal" 3 "Somewhat liberal" 4 "Moderate" 5 "Somewhat conservative" 6 "Very conservative" 7 "Far right", replace
la val ideology ideology
gen ideology5=ideology
recode ideology5 (1=1) (2=1) (3=2) (4=3) (5=4) (6=5) (7=5) 
la de ideology5 1 "Very liberal" 2 "Somewhat liberal" 3 "Moderate" 4 "Somewhat conservative" 5 "Very conservative", replace
la val ideology5 ideology5

* Dependent variables
* Favored sending troops to Bosnia to enforce the Dayton Accords
gen bosnia01=bosnia
recode bosnia01 (1=1) (2=0) (3=0) (8=.) (9=.)
* Would favor the use of U.S. troops if Iraq invaded Saudi Arabia
gen iraq01=iraq
recode iraq01 (1=1) (2=0) (3=0) (8=.) (9=.)
* Would favor the use of U.S. troops if there were an uprising in Cuba
gen cuba01=cuba
recode cuba01 (1=1) (2=0) (3=0) (8=.) (9=.)
* Strongly supports the use of U.S. troops to end the civil war in Somalia
gen somalia01=somalia
recode somalia01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)
* Strongly supports expanding NATO into Eastern Europe
gen nato01=nato
recode nato01 (1=1) (2=0) (3=0) (4=0) (5=0) (8=.) (9=.)

* Table A-8 (Appendix)
* Favored sending troops to Bosnia to enforce the Dayton Accords
logit bosnia01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store bfull
quietly logit bosnia01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats bfull pionly
lrtest bfull pionly

* Would favor the use of U.S. troops if Iraq invaded Saudi Arabia
logit iraq01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store ifull
quietly logit iraq01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats ifull pionly
lrtest ifull pionly

* Would favor the use of U.S. troops if there were an uprising in Cuba
logit cuba01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store cfull
quietly logit cuba01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats cfull pionly
lrtest cfull pionly

* Strongly supports the use of U.S. troops to end the civil war in Somalia
logit somalia01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store sfull
quietly logit somalia01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats sfull pionly
lrtest sfull pionly

* Strongly supports expanding NATO into Eastern Europe
logit nato01 critic convcrit supporter convsupp republican democrat i.ideology5 i.occcat if birthyr~=6
est store nfull
quietly logit nato01 republican democrat i.ideology5 i.occcat if critic~=. & birthyr~=6
est store pionly
est stats nfull pionly
lrtest nfull pionly

* Marginal effects used to produce Figure 8
* Favored sending troops to Bosnia to enforce the Dayton Accords
est res bfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Would favor the use of U.S. troops if Iraq invaded Saudi Arabia
est res ifull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Would favor the use of U.S. troops if there were an uprising in Cuba
est res cfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly supports the use of U.S. troops to end the civil war in Somalia
est res sfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)

* Strongly supports expanding NATO into Eastern Europe
est res nfull
margins, at(critic=1 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=1 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=1 supporter=0 republican=0 democrat=0 ideology5=3 occcat==21)
margins, at(critic=0 convcrit=0 convsupp=0 supporter=1 republican=0 democrat=0 ideology5=3 occcat==21)
